package org.lex.game.sudoku.model.builder;

import org.lex.game.sudoku.model.SudokuModel;
import org.lex.game.sudoku.model.SudokuModelListener.Cause;

public class IntArraySudokuBuilder implements SudokuBuilder {
	private int[][] array = null;

	public IntArraySudokuBuilder() {
	}

	public IntArraySudokuBuilder(int[][] array) {
		this.array = array;
	}

	public int[][] getArray() {
		return array;
	}

	public void setArray(int[][] array) {
		this.array = array;
	}

	public void build(SudokuModel model) {
		int gridSize = model.getGridSize();
		for (int row = 0; row < gridSize; row++) {
			for (int col = 0; col < gridSize; col++) {
				model.set(Cause.SYSTEM, row, col, array[row][col]);
			}
		}
	}

}
